import service from "@/utils/request"

import LoginWork from "@/utils/LoginWork" 
// 整体查询
export interface MaterialsReceivedAndIssuedInquiriesInterface{
    inDtos: inDtos[],
    size: any[],
    style: any
    outDtos: inDtos[]
    sizeTotal:any[]
}

interface inDtos{
    slipNo?: any,
    deptNo: any,
    deptName: string,
    slipDate: string,
    qty1: number | string,
    qty2: number | string,
    qty3: number | string,
    qty4: number | string,
    qty5: number | string,
    qty6: null | number | string,
    qty7: null | number | string,
    qty8: null | number | string,
    qty9: null | number | string,
    qty10: null | number | string,
    qty11: null | number | string,
    qty12: null | number | string,
    qty13: null | number | string,
    qty14: null | number | string,
    qty15: null | number | string,
    qty16: null | number | string,
    qty17: null | number | string,
    qty18: null | number | string,
    qty19: null | number | string,
    qty20: null | number | string,
    qty21: null | number | string,
    qty22: null | number | string,
    qty23: null | number | string,
    qty24: null | number | string,
    qty25: null | number | string,
    qty26: null | number | string,
    ttlQty: number | string,
    remark: null | string,
    change?:boolean,
    disable?:boolean
}

interface style{
    color: string,
    qty: string,
    style: string,
    deliveryDate: string
}

export const InsoleSendingAndReceivingQuery = (lotNo:string) => {
    return LoginWork.post<any,any>(`/pcFactorStockQuery/getSoleXDIOQuery?lotNo=${lotNo}`)
}

// 新增全部收料
export interface AddedAllIncomingMaterialsParms{
    lotNo:string
    deptName:any,
    deptNo:any,
    qty1:number | string,
    qty2:number | string,
    qty3:number | string,
    qty4:number | string,
    qty5:number | string,
    qty6:number | string,
    qty7:number | string,
    qty8:number | string,
    qty9:number | string,
    qty10:number | string,
    qty11:number | string,
    qty12:number | string,
    qty13:number | string,
    qty14:number | string,
    qty15:number | string,
    qty16:number | string,
    qty17:number | string,
    qty18:number | string,
    qty19:number | string,
    qty20:number | string,
    qty21:number | string,
    qty22:number | string,
    qty23:number | string,
    qty24:number | string,
    qty25:number | string,
    qty26:number | string,
    remark:string,
    sendNo:string,
    slipDate:string,
    slipNo:string,
    slipType:string,
    change?:boolean
    disableConfirm?:boolean
}

export const AddedAllIncomingMaterials = (pamrs:AddedAllIncomingMaterialsParms,length:number) => {
    return LoginWork.put<any,any>(`/pcFactorStockQuery/soleXDIOAdd?length=${length}`,pamrs)
}

export interface GetVendorListListParms{
    pageNum:number,
    pageSize:number
}

export const GetVendorList = (parms:GetVendorListListParms) => {
    return service.put<any,any>(`/back/getVendorQuery`,parms)
}

// 删除当前行数据
export const DeleteTheCurrentRowData = (slipNo:string) => {
    return LoginWork.post<any,any>(`/pcFactorStockQuery/soleXDIODetail?slipNo=${slipNo}`)
}

// 领用单位查询
export const ReceivingUnitQuery = () => {
    return service.get<any,any>(`/back/getLineColQuery`)
}

// 判断指令
export const JudgmentInstruction = (lotNo:string) => {
    return LoginWork.get<any,any>(`/back/getRyLotCheck?lotNo=${lotNo}`)
}

// 指令查询
export const lotNoQuery = (lotNo:string,parms?:any) => {
    parms = {
    pageNum:1,
    pageSize:999
    }
   
    return service.put<any,any>(`/back/getRyLots?lotNo=${lotNo}`,parms)
}

// 生成单据号
export const GenerateDocumentNumber = (lotNo:string) => {
    return LoginWork.post<any,any>(`/pcFactorStockQuery/soleXDIO/slipCreat?lotNo=${lotNo}`)
}

// 打印数据
export const printDate = (printNo:string) => {
    return LoginWork.post<any,any>(`/pcFactorStockQuery/soleXDIO/printf?printNo=${printNo}`)
}

// 指令查询
export const lotNoQuery1 = (lotNo:string,parms?:any) => {
    parms = {
    pageNum:1,
    pageSize:999
    }
   
    return service.put<any,any>(`/back/getRyLots?lotNo=${lotNo}`,parms)
}